<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>欢迎来到注册页面</title>
    <style>.reg.td-btn{text-align: center;padding-top:10px;}</style>
    <script>
        function checkForm() {
            var pw1=document.getElementById("pw1").value;
            var pw2=document.getElementById("pw2").value;
            if(pw1 !==pw2){
                alert("两次输入的密码不一致！");
                return false;
            }
            return true;

        }
    </script>
</head>
<body>
<form method="post" action="register.php" onsubmit="checkForm()">
    <table class="reg">
        <tr><td class="title" colspan="2">欢迎注册新用户</td></tr>
        <tr><td>用户名：<input type="text" name="username"/></td></tr>
        <tr><td>邮箱：<input type="text" name="email"/></td></tr>
        <tr><td>密码：<input type="text" name="password"/></td></tr>
        <tr><td>确认密码：<input type="password"/></td></tr>
        <tr><td colspan="2" class="td-btn">
        <input type="submit" value="提交注册" class="button"/>
        <input type="reset" value="重新填写" onclick="return true" class="button"/>
        </td></tr>
</table>
</form>

</body>
</html>